#include "Game.h"

#include <limits>

enum MainMenu
{
	Quit,
	Play
};

int Game::MainMenu()
{
	std::cout << 
		"Welcome to 'Devil's Jack'!\n\n"
		"[0] Quit.\n[1] Play.\n";

	while(true)
	{
		switch( Input() )
		{
		case Quit:
			return Quit;
			break;
		case Play:
			return Play;
			break;
		default:
			std::cout << "Invalid statement reciprocated; Please reiterate in standard binary form.\n";
		}
	}
}

int Game::Input()
{
	int choice = 0;

	do	
		std::cin >> choice;	
	while(choice > 2);

	if(choice < 1)
		Running = false;
		
	return choice;
}

void Game::PressKeyToContinue()
{
	std::cout << "[Enter] Continue..";

	std::streamsize size;
	std::streambuf* pbuf;
	pbuf = std::cin.rdbuf();
	size = pbuf->in_avail();

	if(size > 0)
	{
		std::cin.clear();
		std::cin.ignore(INT_MAX, '\n');
	}

	while(std::cin.get() != '\n')
		continue;

	system("CLS");
}